package com.dcy1.dao;

import com.dcy1.po.UserInfo;
import org.springframework.stereotype.Repository;

@Repository
public class UserInfoDao {

    //假设这是我们数据库中的用户名和密码
    private final String USER_NMAE="admin";
    private final String USER_PWD="123456";

    public UserInfo queryUserByName(String userName){
        UserInfo userInfo=null;
        //下面我们先判断有没有这个用户名
        if(USER_NMAE.equals(userName)){//说明数据库中有这个用户
            userInfo=new UserInfo();
            userInfo.setUserId(1);
            userInfo.setUserName(userName);
            userInfo.setUserPwd(USER_PWD);
        }
        return userInfo;
    }
}
